{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据加载和简单的数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from matplotlib import pyplot as plt\n",
    "from sklearn import datasets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "iris = datasets.load_iris()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['data', 'target', 'target_names', 'DESCR', 'feature_names', 'filename'])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "#print(iris.DESCR)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
       "       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
       "       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['setosa', 'versicolor', 'virginica'], dtype='<U10')"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.target_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = iris.data[: , :2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(150, 2)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x31c6bb8d48>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD5CAYAAAA3Os7hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAZtElEQVR4nO3df6wdZZ3H8fd3LxWv+OMucl3wtthd1vCHFq3cQLvdGAK6/iKlWzGWwGrNCuuvVRejWQzRpCFpDBtWVxJJC9mAVMSt2K0GVjGEKCw0uQWkrtUIirQF7RW2IFpZWr77xzm33E7PPTPTee7MM898Xgnhnjlzz3zn6eTb05nPPGPujoiItN+fNF2AiIiEoYYuIpIINXQRkUSooYuIJEINXUQkEWroIiKJOKboimY2AkwBe9z93Mx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r49/7ptmvN7LjMOjGMZ5E6ofnxnG0NcNOA5TGM52xz1QkNj6e77wH+BXgUeJzeYzu/l1nt0Hi6+wHgKeCVwz436YZuZucCe919+5DVvg0sdvfTgO/zwt+ITVjh7m8C3gF81MzenHl/0N/OTeRO8+q8j94/c98AfBnYUneB9L79vAn4irsvBX4P/HNmnRjGs0idMYwnAGb2ImAl8B+D3h6wrJFcdE6djY+nmf0pvW/gfw68GjjOzC7KrjbgV4eOZ9INnd7zUFea2SPA14GzzezG2Su4+xPu/mz/5Ubg9HpLPKyWx/r/3wt8Czgjs8puYPa/IBZy5D/T5l1ene7+tLs/0//5VmCBmZ1Qc5m7gd3uvq3/ejO9xpldp+nxzK0zkvGc8Q7gPnf/zYD3YhjPGXPWGcl4vgX4pbtPu/tzwC3AX2XWOTSe/dMyrwCeHPahSTd0d7/M3Re6+2J6//y6w90P+1swc45vJbCzxhJn13Gcmb1s5mfgb4AfZ1bbCryvnyZYRu+faY/HVqeZnThzrs/MzqB3nD1RZ53u/mtgl5md2l90DvCTzGqNj2eROmMYz1kuYO7TGI2P5yxz1hnJeD4KLDOzl/RrOYcje89W4P39n8+n17+GfkPPfUh0isxsHTDl7luBj5vZSuAAvb/91jZU1p8B3+ofZ8cAX3P3/zKzDwG4+zXArfSSBA8BfwA+EGmd5wMfNrMDwH5gTd6BOE/+EdjU/+f3L4APRDieReqMYjzN7CXAW4F/mLUsuvEsUGfj4+nu28xsM73TPweA+4ENmd50HfBVM3uIXm9ak/e5uvVfRCQRSZ9yERHpEjV0EZFEqKGLiCRCDV1EJBFq6CIiiVBDFxFJhBq6iEgi/h+iy0wSkAes6wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[: , 0], X[: , 1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x31cb51b6c8>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD5CAYAAAA3Os7hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAe90lEQVR4nO3df4wkZ3kn8O93uh3weGEd4dGF27W7g3KKxGIb45HPnE8RYeZOIZhFJ4i00XDJoqC564YL4HjNESvr3ZVWp4iTsRJrxmpAkc1OgjmH5HZtk8RrggS6sNGsMevY5g8f2fEP4DzB5/UtS2Bn9rk/qment6dr3ren3656q/r7kVrTXVX91tPV5ce9VU89RTODiIgU31jeAYiISBhK6CIiJaGELiJSEkroIiIloYQuIlISSugiIiVR9V2QZAXAIoCXzOzWrnl7AXwGwEvtSfea2ec3G++qq66yer3eV7AiIqPu5MmT/2RmE73meSd0AB8H8CyAN6bMf9DMPuY7WL1ex+LiYh+rFxERkktp87wOuZDcCeC9ADb91S0iIvnxPYZ+D4A7AFzYZJkPkDxF8iGSV/dagOQsyUWSi8vLy/3GKiIim3AmdJK3AnjZzE5ustgxAHUzuw7AcQD391rIzFpmNmlmkxMTPQ8BiYjIFvn8Qr8FwG6SpwF8CcC7SR7pXMDMfmRmP22//ByAG4NGKSIiTs6EbmafNrOdZlYHsAfA18zsQ53LkHxzx8vdSE6eiohIhvqpcrkEyUMAFs3sKIDfJbkbwAqAVwDsDROeiIj46uvCIjP7+loNupntbyfztV/xu8zsejP7VTP77jCClZJaWADqdWBsLPm7sJB3RCKFtOVf6CJBLCwAs7PAuXPJ66Wl5DUAzMzkF5dIAen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TItue3rEmfv2NLMTJB9CcvhnBcC3AbS68tIXAHyR5HNI8tIen7F16b+ISEmU+pCLiMgoUUIXESkJJXQRkZJQQhcRKQkldBGRklBCFxEpCSV0EZGS+P/vm+3fAVC+HgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y == 0, 0], X[y == 0, 1], color =\"red\")\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1], color =\"blue\")\n",
    "plt.scatter(X[y == 2, 0], X[y == 2, 1], color =\"green\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x31cb545e48>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAaAklEQVR4nO3df4wcZ3kH8O/3dvfaLBAj1acSn+1bSimSDYTEpwACRW7PVAGHJOoPKanbQmh11R2hSdOqAiwlEMl/9J80hXB2r+Qch7sG2gRoQkIpCaAGQQN3bhLHMZFclEscp+SA1iY1rX3np3/MnL23N3P7zs7s/NrvR1rZM/vOzLMgHsbv+7zvSzODiIgUX1/WAYiISDKU0EVESkIJXUSkJJTQRURKQgldRKQkqlk9eP369dZoNLJ6vIhIIc3Nzf3YzAaCvsssoTcaDczOzmb1eBGRQiI5H/adulxEREpCCV1EpCSU0EVESkIJXUSkJJTQRURKQgldRKQklNBFREqibUInuYnkN0keIXmY5I0BbbaTPEHyCf9z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4VkDcC3AdxoZv+WcWgdI3kzgGEAF5rZlVnH0ymSzwEYNrPCT8QheQDAY2b2WZL9AOpm9t9ZxxWHv6LtiwDebmZxJlsW7w3dzP4VJVlWwMxeMrOD/t9/BuAIVi98VgjmecU/rPmfYr0tNCG5EcBOAJ/NOhbxkLwQwOXwJjLCzE4XPZn7RgD8R9xkDhQwoZeVvynIJQAezzaSzvldFE8AeBnA182ssL8FwB0A/hLA2awDSYAB+BeScySLvDnurwBYALDf7wr7LMlXZR1UAq4FcG8SN1JCzwGSrwZwP4CbzOxk1vF0ysyWzOxt8BZwu4xkIbvESF4J4GUzm8s6loS8y8wuhbdJzYf9bssiqgK4FMBeM7sEwP8AWLWDWpH43UZXAfjHJO6nhJ4xv7/5fgAzZvbFrONJgv/P4G8BuCLjUDr1LgBX+X3PnwfwGySnsw2pc2Z23P/zZQBfgrdpTREdA3Cs6V9+98FL8EX2XgAHzexHSdxMCT1D/kDiXQCOmNntWccTB8kBkq/1/34BgB0AfpBtVJ0xs4+Z2UYza8D75/A3zOz3Mw6rIyRf5Q+4w++e+E0AhawQM7P/BPACyTf5p0YAFK6AoMV1SKi7BXBcnCtPSN4LYDuA9SSPAbjVzO7KNqqOvQvAHwA45Pc9A8DH/cXQiuYiAAf8Efs+AP9gZoUu9yuJXwbwJX9HyCqAvzezf842pFg+AmDG76r4IYDrM46nYyTrAN4D4E8Su2fRyhZFRCSYulxEREpCCV1EpCSU0EVESkIJXUSkJJTQRURKQgldRKQklNBFREri/wFtwYHtyKAUJQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "X = iris.data[: , 2 : ]                   #后两列\n",
    "plt.scatter(X[y == 0, 0], X[y == 0, 1], color =\"red\")\n",
    "plt.scatter(X[y == 1, 0], X[y == 1, 1], color =\"blue\")\n",
    "plt.scatter(X[y == 2, 0], X[y == 2, 1], color =\"green\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
